<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="/resource/css/admin/main.css" type="text/css" rel="stylesheet" />
<link href="/resource/css/admin/right.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/resource/js/jquery.js"></script>
<script type="text/javascript" src="/resource/js/base.js"></script>
</head>
<body>
	<div class="position"><span>您的当前位置：</span>系统设置 > 审核流程管理</div>
	<div class="rightbody f">
		<div class="rightbodycontent">
		   	<table class="tools">
		       	<tr>
		            <td align="right">
		            	<a href="edit" class="linkbtn insert">新建审核流程</a>
		            </td>
		        </tr>
		    </table>
		    <table cellspacing="1" cellpadding="4" class="tablelist">
		        <tr>
		            <th width="35%">流程名称</th>
				    <th>子节点数</th>
				    <th>是否启用</th>
				    <th>占用状态</th>
				    <th>操作</th>
		        </tr>
		        <#list checkflows as checkflow>
		        	<#assign isfirst = true>
		        	<#assign firstnodearticlecount = -1>
		        	<#assign isuse = false>
		        	<#list checkflow.checknodes as checknode>
		        		<#if !isuse>
			        		<#if isfirst>
			        			<#assign firstnodearticlecount = checknode.checknodeReAdmins?size>
			        			<#assign isfirst = false>
			        		</#if>
			        		<#if checknode.articles?size gt 0>
			        			<#assign isuse = true>
			        		</#if>
		        		</#if>
		        	</#list>
					<tr<#if checkflow_index % 2 == 1> class="splittr"</#if>>
						<td align="center">${checkflow.name}</td>
						<td align="center">${checkflow.checknodes?size}</td>
						<td align="center"><a<#if !isuse> href="isactive?checkflowid=${checkflow.id}"</#if> onclick="${isuse?string("alert('该流程当前处于占用状态，无法停用'); return false;",((firstnodearticlecount == 0)?string("alert('该流程首节点未设置参与人员，无法启用'); return false;","")))}"><img src="/resource/image/admin/main/right/ico/${checkflow.active?string("ok","delete")}.png" /></a></td>
						<td align="center"><img src="/resource/image/admin/main/right/ico/${isuse?string("use","free")}.png" /></td>
						<td align="center">
						    <a<#if !isuse> href="edit?checkflowid=${checkflow.id}"</#if> class="linkbtn update noborder" onclick="<#if !isuse>alert('该流程当前处于占用状态，无法修改');}</#if>">修改</a>
						    <a href="../checknode/?checkflowid=${checkflow.id}" class="linkbtn intoson noborder">管理流程节点</a>
						    <a<#if !isuse> href="delete?checkflowid=${checkflow.id}"</#if> class="linkbtn delete noborder" onclick="${isuse?string("alert('该流程当前处于占用状态，无法删除'); return false;","return confirm('确定删除吗？')")}">删除</a>
					    </td>
					</tr>
		        </#list>
		    </table>
	    </div>
    </div>
</body>
</html>